<?xml version="1.0" encoding="utf-8"?>
<Content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:blueonionsoftware-com:bloget:runtime:data">
  <text>Question: When rethrowing an exception in a catch block in C#, what is the difference between:

&lt;strong&gt;throw;&lt;/strong&gt;

and 

&lt;strong&gt;throw ex;&lt;/strong&gt;

where ex is the local name of the exception in the catch block?

Answer: &lt;strong&gt;throw ex;&lt;/strong&gt; will start a new exception stacktrace and destroy the old one hiding the source of the original exception. &lt;strong&gt;throw;&lt;/strong&gt; will keep the exception stacktrace.</text>
  <last_update>2007-10-04T00:52:31.4830806Z</last_update>
  <source_title />
  <source_link />
  <comments />
  <references />
  <attachments />
</Content>